Chris Pollett > Old Classes >
CS152

( Print View )

Student Corner:
  [Grades Sec1]

  [Submit Sec1]

  [Class Sign Up Sec1]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Hw6]

Practice Exams:
  [Mid]  [Final]

                           












HW#1 --- last modified February 28 2019 22:31:33..

Solution set.

Due date: Sep 15

Files to be submitted:
  Hw1.zip

Purpose: To learn a little about the history of programming languages. To refresh our C coding skills before we look at flex and bison.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

(1) Have a basic knowledge of the history of programming languages. (2) Have a basic knowledge of the procedural, object-oriented, functional, and logic programming paradigms. (In this case we are looking at a procedural language C and the logic programming-esque language make.)

Specification:

For this assignment you will create a C program which compiles with a recent version of gcc for displaying information about historical programming languages. When you are done your project you should ZIP the files into Hw1.zip and upload them. To run your program, the grader will cd into your Hw1 directory and type:

make all

So that you have experimented a little with make, the Makefile should have at least the following targets: all, io, linkedlist, test, and clean. It should also make at least one use of a variable and one use of a pattern. The grader will type:

historylesson

At which point your program should display an introductory page. At the bottom of the page there should be a sentence like: "Type N to see the first language." Hitting N should display a page of text containing information about the first programming language you researched. The information on the programming languages you studied should be stored in the lang subdirectory of your Hw1 directory in separate text files. Each file should have the format:

Title
<blankline>
Description
<blankline>
filename of next language

In addition, this directory should have one file start.txt which has a single-line giving the name of the first language to look at. An API for reading in these kind of files should be in the io subdirectory of your Hw1 directory, and make io should compile just this. Your program should use this API when it reads these files into a linked-list. The node struct for your linked-list should be called TextNode. Its definition as well as an API for linked-list should be in the linkedlist subdirectory of Hw1. Your program should use this API when it needs to manage which page to display. After displaying the first programming language at the botton of the page there should be a line like: "Type P to go to the previous page; type N for the next page". The P and N page should then work either by going to previous page or by showing the next programming language given by the data from the text file of the currently display language. Subsequent pages should display in a similar fashion. If there is no next page then only the "Type P to go to the previous page" message should be displayed. You should also come up with some reasonable way to exit the program such as hitting Q.

For the programming language descriptions: one can be a made up silly language of your choice, the other two should be actual languages mentioned in Chapter 2 of our text. For at least one of these, I would like you to check out a manual for it from the library. This language should be at least 20 years old, and the manual should be for a computer that no longer exists. If it is not easy for you to go the eighth floor of the library, you can probably find out info using the online catalog about such a book and get someone else to check it out. The eighth floor has lots of old computer manuals which probably haven't been checked out in decades, so this way they will feel some love. You might also want to see if any old language was ever developed at SJSU.

As a final part of this assignment, you should write unit tests for the io API and linkedlist API you create. These should be compilable with the line make test; and they should generate an excutable testprog which can be used to run the tests.

Point Breakdown

Following the departmental coding guidelines for C/C++ 1pt
When unzipped the lang subdirectory of Hw1 has the three programming language descriptions in the format describe above. 3pt
Makefile is as described above. make all has the desired result. 2pts
TextNode struct is implemented as described. 1pt
Program can read files in lang directory. 1pt
Running program and hitting n and p have the effect described above 1pt
make test compiles tests for the TextNode code and for the File IO code 1pt
Total10pts